package com.slipper.core.database.vo;

import com.slipper.constants.Constants;

import java.util.ArrayList;
import java.util.List;

public class IndexVO {
    /** 名称 */
    private String name;
    /** 是否唯一索引 */
    private String unique;
    /** 字段列表 */
    private List<IndexFieldVO> fieldList = new ArrayList<>();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isUnique() {
        return Constants.YES.equals(unique);
    }

    public String getUnique() {
        return unique;
    }

    public void setUnique(String unique) {
        this.unique = unique;
    }

    public List<IndexFieldVO> getFieldList() {
        return fieldList;
    }

    public void setFieldList(List<IndexFieldVO> fieldList) {
        this.fieldList = fieldList;
    }

    public void addField(IndexFieldVO field) {
        fieldList.add(field);
    }
}
